package Test3;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        Map<String, List<Student>> stuMap = new HashMap<>();
        stuMap.put("1", Arrays.asList(new Student("张三", 18), new Student("李四", 19), new Student("王五", 18), new Student("赵六", 20)));

        stuMap.put("2", Arrays.asList(new Student("陈七", 19), new Student("刘八", 18), new Student("孙九", 20), new Student("周十", 19)));

        stuMap.forEach((dorm, student) -> {
            System.out.println("宿舍：" + dorm+"学生"+ student);
        });
    }

}
